@model ContentDeploymentStepViewModel
@inject OrchardCore.ContentManagement.Metadata.IContentDefinitionManager ContentDefinitionManager

@{
    var contentTypes = (string[])Model.ContentTypes;
}

<h5>@T["Content Types"]</h5>
<span class="hint">@T["The content types to add as part of the plan."]</span>

<div class="form-group w-md-50">
    <ul class="list-group">
        @foreach (var contentTypeDefinition in ContentDefinitionManager.ListTypeDefinitions().OrderBy(i => i.Name))
        {
            var name = contentTypeDefinition.Name;
            var checkd = contentTypes?.Contains(name);

            <li class="list-group-item">
                <div class="custom-control custom-checkbox">
                    <input type="checkbox" class="custom-control-input" id="@(Html.IdFor(m => m.ContentTypes) + "_" + contentTypeDefinition.Name)" name="@Html.NameFor(m => m.ContentTypes)" value="@name" checked="@checkd">
                    <label class="custom-control-label" for="@(Html.IdFor(m => m.ContentTypes) + "_" + contentTypeDefinition.Name)">@contentTypeDefinition.DisplayName</label>
                </div>
            </li>
        }
    </ul>
</div>
